<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ page import="Jama.Matrix" %>

<%@ include file="/header" %>

<%     
    response.setHeader("Cache-Control", "no-cache");
    
    Matrix matrixS = null;
    int i = 0;
    int j = 0;
    
    try
    {
        matrixS = (Matrix)request.getAttribute("matrixS");
    }
    catch(Exception e)
    {
        response.sendRedirect(siteRoot+"/RebuildIndex");
    }
    
    if(matrixS == null)
    {
        response.sendRedirect(siteRoot+"/RebuildIndex");
    }
%>
    
<div id="indexForm">
    <p>Select desired cut value (k-value) for the Sigma matrix from LSI.</p>
    <form action="<%=siteRoot%>/RebuildIndex" method="post">
        <input type="hidden" name="sn" value="3" />
        <table>
            <%
                for(i=0; i<matrixS.getRowDimension(); i++)
                {
            %>
            <tr>
                <td>
                    <input type="radio" name="k" value="<%=i%>"
                    <% if(i == matrixS.getRowDimension() - 1) out.write("checked"); %>
                    />k = <%=i%>
                </td>
                <%
                    for(j=0; j<matrixS.getColumnDimension(); j++)
                    {
                %>
                <td>
                    <%=matrixS.get(i,j)%>
                </td>
                <%
                    }
                %>
            </tr>
            <%
                }
            %>
        </table>
        <p><input type="image" id="indexSubmitIcon" src="<%=siteRoot%>/index/next.png" alt="Set k-value" title="Set k-value" /></p>
    </form>
</div>
    
<%@ include file="/footer" %>